package com.xca.znb.model.impl;

import android.content.Context;

import com.xca.znb.database.UserDAO;
import com.xca.znb.entity.Collect;
import com.xca.znb.entity.Goods;
import com.xca.znb.entity.News;
import com.xca.znb.entity.User;
import com.xca.znb.model.imodel.ICollect;

import java.util.List;

public class CollectImpl implements ICollect {
    private UserDAO userDAO ;
    public CollectImpl(Context context){
        userDAO = new UserDAO(context);
    }

    @Override
    public List<Collect> getCollect(String phone, String type) {
        return userDAO.getCollect(phone, type);
    }

    @Override
    public Collect getCollectById(int id) {
        return userDAO.getCollectById(id);
    }

    @Override
    public void delCollect(int id) {
        userDAO.delCollect(id);
    }

    @Override
    public Goods getGoodsById(int id) {
        return userDAO.getGoodsById(id);
    }

    @Override
    public User getUser(String phone) {
        return userDAO.getUser(phone);
    }

    @Override
    public News getNewsById(int id) {
        return userDAO.getNewsById(id);
    }

    @Override
    public void addOrUpdateFoot(int goodsId, String user, String time) {
        userDAO.addOrUpdateFoot(goodsId,user,time);
    }
}
